#ifndef ASGKA_SPACE_H
#define ASGKA_SPACE_H

#define GROUPKEYR 0
#define GROUPKEYA 1

#ifndef IN
#define IN
#endif

#ifndef OUT
#define OUT
#endif

#include "include/pbc.h"

extern "C"
{
void setupSystem(char *generator, int base);

void closeSystem();

void generateKeys(OUT char *priR, OUT char *priX, OUT char *priO,OUT char *pubR, 
	OUT char *pubA, OUT char *pubH, IN int keyLength, IN int *PriKeyRLength);

void computeGroupKey(OUT char *resultbuf, IN  char *singlePubKeyR, 
	IN  char *singlePubKeyA, IN int keyLength, IN int type);

void computeDecryptKey(OUT char *decryptKeybuf, IN  char *myPriO, 
	IN  char *otherPubO, IN int keyLength);

void computeOtherPubO(OUT char *PubObuf, IN char *myPriX, IN char *myPriR, 
	IN char *otherPubH, IN int keyLength);

void encryption(OUT char *ciphertext1, OUT char *ciphertext2, OUT char *ciphertext3,
	IN  char *GroupKeyR, IN char *GroupKeyA, IN  char *plaintext, IN int keyLength);

void decryption(OUT char *plaintext, IN  char *ciphertext1, IN char *ciphertext2, 
	IN char *ciphertext3, IN char *myPriO, IN  char *myPubH, IN int keyLength);

void randomG1(OUT char *buf, IN int keyLength);

void randomG2(OUT char *buf, IN int keyLength);

void asgkaDivG1(OUT char *buf, IN char *a, IN char *b, IN int keyLength);

void asgkaDivG2(OUT char *buf, IN char *a, IN char *b, IN int keyLength);

void asgkaDivGT(OUT char *buf, IN char *a, IN char *b, IN int keyLength);

void asgkaMulG1(OUT char *buf, IN char *a, IN char *b, IN int keyLength);

void asgkaMulG2(OUT char *buf, IN char *a, IN char *b, IN int keyLength);

void asgkaMulGT(OUT char *buf, IN char *a, IN char *b, IN int keyLength);
}

#endif

